package com.common.help.test18;

public class Child extends Base {
    
    private long sum;

    @Override
    public void add(int number) {
        super.add(number);
        sum+=number;
    }

    @Override
    public void addAll(int[] numbers) {
        super.addAll(numbers);
    }
    
    public long getSum() {
        return sum;
    }
    
    @Override
	public void clear() {
		super.clear();
		this.sum = 0;
	}

	public static void main(String[] args) {
		Child b = new Child();
		b.addAll(new int[]{1,2,3});
		b.clear();
		b.addAll(new int[]{1,2,3});
		System.out.println(b.getSum());
	}
}
